public class MoveZero {

    public static void move(int[] nums){
       int n=nums.length; int right=0; int left=0;
       while (right<n){
           if(nums[right]!=0){
               int temp=nums[right];
               nums[right]=nums[left];
               nums[left]=temp;
               left++;
           }
           right++;
       }
    }

    public static void main(String[] args) {
        int[] nums={0,1,0,3,12};
        move(nums);
    }
}
